package com.beans;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;

@Controller
public class UserController {

//    @Autowired
//    @Qualifier(value = "user1")
    @Resource(name = "user2")
    private User user;
//    public void  sayHi(){
//        System.out.println("你好，Controller");
//    }
    public void  sayHi(){
        System.out.println("User："+user.toString());
    }
}
